home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 05 - 1989 / 05.03 Mar 89 / calc source / MacCalc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-12-09  |  1.5 KB  |  77 lines  |  [TEXT/KAHL]

  1. #include <MacTypes.h>
  2. #include <ListMgr.h>
  3.  
  4. #ifndef NULL
  5. #define NULL    0L
  6. #endif
  7. #define MAX_ROWS    8
  8. #define MAX_COLUMNS    8
  9.  
  10. #define CELL_WIDTH    96
  11. #define CELL_HEIGTH 16
  12.  
  13. #define ENTER_DATA_DIALOG        128
  14. #define APPLE_MENU                1
  15. #define FILE_MENU                256
  16. #define EDIT_MENU                257
  17.  
  18.  
  19. /* Types for cell */
  20. #define CLEARED        -1
  21. #define UNDEFINED    0
  22. #define STRING        1
  23. #define FORMULA        2
  24. #define CONSTANT    3
  25.  
  26. struct cell_struct{
  27.     int type ;
  28.     double value ;
  29.     Str255 formula ;
  30. } ;
  31.  
  32. typedef struct cell_struct CELL, *CELL_PTR, **CELL_HDL ;
  33.  
  34. struct sheet_win{
  35.     WindowPtr sheet_window_ptr ;
  36.     ListHandle sheet_list_hdl ;
  37.     CELL sheet_data[MAX_ROWS][MAX_COLUMNS] ;
  38. } ;
  39.  
  40. typedef struct sheet_win SHEET_WIN, *SHEET_WIN_PTR, **SHEET_WIN_HDL ;
  41.  
  42. /* Argument types */
  43. #define VALUE_ARG 1
  44. #define STRING_ARG 2
  45.  
  46. /* Arg usage defines */
  47. #define IN_USE   TRUE
  48. #define FREE_ARG FALSE
  49.  
  50. struct fun_arg{
  51.     struct fun_arg *next_arg ;
  52.     int in_use ;
  53.     int type ;
  54.     double value ;
  55.     Str255 string ;
  56. } ;
  57.  
  58. typedef struct fun_arg ARG, *ARG_PTR, **ARG_HDL ;
  59.  
  60. struct fun_entry{
  61.     char fun_name[32] ;
  62.     double (*fun_ptr)( ) ;
  63. } ;
  64.  
  65. typedef struct fun_entry FUN_ENTRY, *FUN_ENTRY_PTR, **FUN_ENTRY_HDL ;
  66.  
  67. /* Prototypes */
  68. int DoInit( void ) ;
  69. void DoEventLoop( void ) ;
  70. void DoActivate( EventRecord * ) ;
  71. void DoUpdate( EventRecord * ) ;
  72. void DoMouseDown( EventRecord * ) ;
  73.  
  74. int ClikLoop( void ) ;
  75. void EnterData( Cell, SHEET_WIN_HDL ) ;
  76. void DoCalc( SHEET_WIN_HDL ) ;
  77.